package leifeng.bs.service.impl;

import java.io.File;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import leifeng.bs.base.DaoSupportImpl;
import leifeng.bs.domain.ApplicationTemplate;
import leifeng.bs.service.ApplicationTemplateService;

@Service
@Transactional
public class ApplicationTemplateServiceImpl extends DaoSupportImpl<ApplicationTemplate> implements ApplicationTemplateService {

	/** 重写删除文件 */
	@Override
	public void delete(Long id) {
		//删除数据库记录
		ApplicationTemplate applicationTemplate=getById(id);
		getSession().delete(applicationTemplate);
		//删除文件
		File file=new File(applicationTemplate.getPath());
		if(file.exists()){
			file.delete();
		}
		
	}

	
	
}
